package src

import (
	"fmt"
	"github.com/go-git/go-git/v6"
	"github.com/go-git/go-git/v6/plumbing/transport/http"
	"os"
)

type GitConfig struct {
	UserName string
	Password string
}

type GitProject struct {
	GitConfig GitConfig
	Name      string
	Repo      string
	Directory string
}

type GitHandle struct {
	Project GitProject
}

func NewGitHandle(project GitProject) *GitHandle {
	return &GitHandle{
		Project: project,
	}
}

func (g *GitHandle) Clone(*git.Repository, error) {
	r, err := git.PlainClone("", &git.CloneOptions{
		Auth: &http.BasicAuth{
			Username: "",
			Password: "",
		},
		URL:      "",
		Progress: os.Stdout,
	})
	if err != nil {
		fmt.Println(err)
	}
	print(r)
}
